SML=/usr/local/smlnj-110.71
CHAP=chap6
ARCH=x86-darwin

compile :	
		$(SML)/bin/ml-build sources.cm Main.main

test :		tcheck

tcheck :	
		-$(RM) -rf tc
		/bin/mkdir tc
		-( for i in ../../testcases/*.tig ;  \
		   do           \
			$(SML)/bin/sml @SMLload=sources                \
				       -u                              \
				       $$i                             \
				       > tc/`basename $$i .tig`.ast    \
				       2> tc/`basename $$i .tig`.err ; \
		   done )

clean :
		-$(RM) -rf sources.$(ARCH) tc *~ tiger.grm.* tiger.lex.* .cm